package net.wwang.blog.pojo;

import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.sql.Timestamp;


@EntityListeners(AuditingEntityListener.class)
@Data
@Entity
@Table(name = "article")
public class Article {

  @Id
  @Column(name = "id")
  private String id;
  @Column(name = "title")
  private String title;
  @Column(name = "uid")
  private String uid;
  @Column(name = "cid")
  private String cid;
  @Column(name = "user_avatar")
  private String userAvatar;
  @Column(name = "user_name")
  private String userName;
  @Column(name = "cotent")
  private String cotent;
  @Column(name = "type")
  private String type;
  @Column(name = "state")
  private String state;
  @Column(name = "summary")
  private String summary;
  @Column(name = "label")
  private String label;
  @Column(name = "view_count")
  private long viewCount;
  @Column(name = "register_ip")
  private String registerIp;
  @CreatedDate
  @Column(name = "create_time")
  private Timestamp createTime;
  @LastModifiedDate
  @Column(name = "modify_time")
  private Timestamp updateTime;

}
